package com.zmn.plat.dubbo.interfaces.orderconfig.orderstock;

import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.plat.common.dto.orderconfig.orderstock.OrderStockDRO;
import com.zmn.plat.common.dto.orderconfig.orderstock.SpOrderStockDRO;
import com.zmn.plat.common.dto.orderconfig.orderstock.SpOrderStockWarningDRO;
import com.zmn.plat.dubbo.utils.DubboConsts;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * 描述：订单库存dubbo接口类
 *
 * @author: tanghongjun
 * @time: 2020/4/21 9:40
 */
@Api(value = "订单库存服务", tags = {"订单库存"})
public interface OrderStockListRemoteService {

    /**
     * 描述: 根据前台产品ID/城市ID/时间查询当天库存量
     *
     * @param plat
     *            平台
     * @param date
     *            时间
     * @param cityId
     *            前台产品二级分类分类ID
     * @param showProductId
     *            前台产品ID
     * @return OrderStockDRO
     * @auther tanghongjun
     * @since 2020/4/25 16:10
     */
    @ApiOperation(value = "根据前台产品ID/城市ID/时间查询当天库存量", response = ResponseDTO.class, notes = "", tags = {"订单库存"})
    ResponseDTO<OrderStockDRO> getOrderStockStatusByCityAndDateAndShowProductId(
        @NotNull(message = "plat不能为空") @Positive(message = "plat必须为大于0的正整数") @ApiParam(value = "平台", required = true) Integer plat,
        @NotNull(message = "cityId不能为空") @Positive(message = "cityId必须为大于0的正整数") @ApiParam(value = "城市id", required = true) Integer cityId,
        @NotNull(message = "date不能为空") @ApiParam(value = "时间", required = true) Date date,
        @NotNull(message = "showProductId不能为空") @Positive(message = "showProductId必须为大于0的正整数") @ApiParam(value = "前台产品id", required = true) Integer showProductId);

    /**
     * 描述: 根据城市、分类和时间查询订单库存量
     *
     * @param plat
     *            平台
     * @param cityId
     *            城市ID 不能为空
     * @param servCategId
     *            服务分类ID 必传
     * @param date
     *            时间（精确到天） 必传
     * @return 库存量
     * @auther tanghongjun
     * @since 2020/4/21 9:44
     */
    @ApiOperation(value = "根据城市、分类和时间查询订单库存量", response = ResponseDTO.class, notes = "", tags = {"订单库存"})
    ResponseDTO<OrderStockDRO> getCityOrderStockByPlatAndCityAndCategAndDate(@NotNull(message = "plat不能为空") @Positive(message = "plat必须为大于0的正整数") @ApiParam(value = "平台", required = true) Integer plat,
        @NotNull(message = "cityId不能为空") @Positive(message = "cityId必须为大于0的正整数") @ApiParam(value = "城市id", required = true) Integer cityId,
        @NotNull(message = "servCategId不能为空") @Positive(message = "servCategId必须为大于0的正整数") @ApiParam(value = "服务分类id", required = true) Integer servCategId,
        @NotNull(message = "date不能为空") @ApiParam(value = "时间", required = true) Date date);

    /**
     * 描述: 根据城市服务商分类和时间查询服务商库存量
     *
     * @param plat
     *            平台 必传
     * @param cityId
     *            城市ID 必传
     * @param spId
     *            服务商ID 必传
     * @param servCategId
     *            服务分类ID 必传
     * @param date
     *            时间（精确到天） 必传
     * @return 库存量
     * @auther tanghongjun
     * @since 2020/4/21 9:44
     */
    @ApiOperation(value = "根据城市服务商分类和时间查询服务商库存量", response = ResponseDTO.class, notes = "", tags = {"订单库存"})
    ResponseDTO<OrderStockDRO> getSpOrderStockByPlatAndCityAndSpAndCategAndDate(
        @NotNull(message = "plat不能为空") @Positive(message = "plat必须为大于0的正整数") @ApiParam(value = "平台", required = true) Integer plat,
        @NotNull(message = "cityId不能为空") @Positive(message = "cityId必须为大于0的正整数") @ApiParam(value = "城市id", required = true) Integer cityId,
        @NotNull(message = "spId不能为空") @Positive(message = "spId必须为大于0的正整数") @ApiParam(value = "服务商ID", required = true) Integer spId,
        @NotNull(message = "servCategId不能为空") @Positive(message = "servCategId必须为大于0的正整数") @ApiParam(value = "服务分类id", required = true) Integer servCategId,
        @NotNull(message = "date不能为空") @ApiParam(value = "时间", required = true) Date date);

    /**
     * 描述: 根据城市服务商分类和时间批量查询服务商库存量
     *
     * @param plat
     *            平台 必传
     * @param cityId
     *            城市ID 必传
     * @param spIdList
     *            服务商ID 集合
     * @param servCategId
     *            服务分类ID 必传
     * @param date
     *            时间（精确到天） 必传
     * @return 库存量
     * @auther tanghongjun
     * @since 2020/4/21 9:44
     */
    @ApiOperation(value = "根据城市服务商分类和时间批量查询服务商库存量", response = ResponseDTO.class, notes = "", tags = {"订单库存"})
    ResponseDTO<List<SpOrderStockDRO>> getSpOrderStockByPlatAndCityAndSpListAndCategAndDate(
        @NotNull(message = "plat不能为空") @Positive(message = "plat必须为大于0的正整数") @ApiParam(value = "平台", required = true) Integer plat,
        @NotNull(message = "cityId不能为空") @Positive(message = "cityId必须为大于0的正整数") @ApiParam(value = "城市id", required = true) Integer cityId,
        @NotEmpty(message = "spIdList参数不能为空且个数不能超过" + DubboConsts.MAX_PARAM_LENGTH) @Size(min = 1, max = DubboConsts.MAX_PARAM_LENGTH,
            message = "spIdList参数不能为空且个数不能超过" + DubboConsts.MAX_PARAM_LENGTH) @ApiParam(value = "服务商ID集合", required = true) List<Integer> spIdList,
        @NotNull(message = "servCategId不能为空") @Positive(message = "servCategId必须为大于0的正整数") @ApiParam(value = "服务分类id", required = true) Integer servCategId,
        @NotNull(message = "date不能为空") @ApiParam(value = "时间", required = true) Date date);

    /**
     * 描述: 根据城市服务商分类查询服务商库存预警量
     *
     * @param cityId
     * @param spId
     * @param servCategId
     * @param categOneId
     * @param categTwoId
     * @return
     */
    @ApiOperation(value = "根据城市服务商分类查询服务商库存预警量", response = ResponseDTO.class, notes = "", tags = {"订单库存"})
    ResponseDTO<SpOrderStockWarningDRO> getSpOrderStockWarning(@NotNull(message = "cityId不能为空") @Positive(message = "cityId必须为大于0的正整数") @ApiParam(value = "城市id", required = true) Integer cityId,
        @NotNull(message = "spId不能为空") @Positive(message = "spId必须为大于0的正整数") @ApiParam(value = "服务商ID", required = true) Integer spId,
        @NotNull(message = "servCategId不能为空") @Positive(message = "servCategId必须为大于0的正整数") @ApiParam(value = "服务分类id", required = true) Integer servCategId,
        @NotNull(message = "categOneId不能为空") @Positive(message = "categOneId必须为大于0的正整数") @ApiParam(value = "一级分类id", required = true) Integer categOneId,
        @NotNull(message = "categTwoId不能为空") @Positive(message = "scategTwoId必须为大于0的正整数") @ApiParam(value = "二级分类id", required = true) Integer categTwoId,
        @NotNull(message = "date不能为空") @ApiParam(value = "时间", required = true) Date date);
}
